﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace MobilTomegSzerverWCF
{
    public class RouteData
    {
        public string Jarat { get; set; }
        public double Latitude { get; set; }
        public double Longitude { get; set; }
        public bool? Direction { get; set; }
        public bool Active { get; set; }
        public DateTime LastUpdate { get; set; }
        public bool Ellenor { get; set; }
        public bool Crash { get; set; }

        public static RouteData DEFAULT(string jarat)
        {
            return new RouteData
            {
                Jarat = jarat,
                Latitude = 0.0,
                Longitude = 0.0,
                Active = false,
                Direction = null,
                LastUpdate = DateTime.Now,
                Ellenor = false,
                Crash = false
            };
        }
    }

    public partial class RemoteMobile : IRemoteMobile
    {
        public static object _lock = new object();

        public static ReaderWriterLock routelock = new ReaderWriterLock();
        public static ReaderWriterLock alllock = new ReaderWriterLock();

        public static Dictionary<string, Dictionary<Guid, RouteData>> routes =
                                        new Dictionary<string, Dictionary<Guid, RouteData>>();

        public bool Ping()
        {
            return true;
        }
    }
}
